/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.krossk.jspControllers;

import br.com.krossk.dao.AreaDAO;
import br.com.krossk.dao.SegmentoDAO;

import br.com.krossk.model.Area;
import br.com.krossk.model.Segmento;

import java.util.List;

/**
 *
 * @author henriqueap
 */
public class Controller {

    private static  List<Area> areas;
    private static  List<Segmento> segmentos;
    

    private static Controller instance;



    private Controller() {
        this.areas = AreaDAO.getInstance().getAll();
        this.segmentos = SegmentoDAO.getInstance().getAll();
    }

    public static List<Area> getAreas() {
        return areas;
    }

    public static List<Segmento> getSegmentos() {
        return segmentos;
    }

    

    public static void initController(){
        if(instance!=null)
            return;
        instance = new Controller();
    }

    public static void destroyController(){
        if(instance==null)
            return;
        instance = null;
    }
    
}
